package org.androidpush.client;

import org.jivesoftware.smack.packet.IQ;

/**
 * Created by huang on 2017/4/19 0019.
 */
public class ChatMsgIQ extends IQ {

    private String fromuser;

    private String touser;

    private String date;

    private String message;

    private String uuid;

    private String msgtype;

    @Override
    public String getChildElementXML() {

        StringBuilder buf = new StringBuilder();
        buf.append("<").append("chatmsg").append(" xmlns=\"").append(
                "androidpn:iq:chatmsg").append("\">");
        if (fromuser != null) {
            buf.append("<chatfrom>").append(fromuser).append("</chatfrom>");
        }
        if(touser != null){
            buf.append("<chatto>").append(touser).append("</chatto>");
        }
        if(date!=null){
            buf.append("<chatdate>").append(date).append("</chatdate>");
        }
        if(message!=null){
            buf.append("<message>").append(message).append("</message>");
        }
        if(uuid != null){
            buf.append("<uuid>").append(uuid).append("</uuid>");
        }
        buf.append("<msgtype>").append(msgtype).append("</msgtype>");
        buf.append("</").append("chatmsg").append("> ");
        return buf.toString();
    }

    public String getFromuser() {
        return fromuser;
    }

    public void setFromuser(String fromuser) {
        this.fromuser = fromuser;
    }

    public String getTouser() {
        return touser;
    }

    public void setTouser(String touser) {
        this.touser = touser;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getMsgtype() {
        return msgtype;
    }

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public void setMsgtype(String msgtype) {
        this.msgtype = msgtype;
    }
}
